export function ToString(data: Date) {
    var y: number = data.getFullYear();
    var m: number = data.getMonth() + 1;
    var d: number = data.getDate();
    var day: number = data.getDay();
    var h: number = data.getHours();
    var mi: number = data.getMinutes();
    var s: number = data.getSeconds();
    var ms: number = data.getMilliseconds();
    const dateStr = y + "-" + m + "-" + d + " " + h + ":" + mi + ":" + s;
    return dateStr
}

export function ToDate(data: string) {
    const strList = data.split(" ")
    const day = strList[0]
    const time = strList[1]
    const dayList = day.split("-")
    const timeList = time.split(":")
    return new Date(dayList[0], dayList[1]-1, dayList[2], timeList[0], timeList[1], timeList[2])
}